package com.example.pojo.utils;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * TODO
 *
 * @author ding
 * @since 2024/7/2
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("meta")
public class RouteMeta implements Serializable {

    @TableId(type = IdType.INPUT)
    private Integer id;
    private Integer menuId;
    private Integer orderNo;
    private String title;
    private String icon;
    /**
     * 菜单是否显示 0：显示  默认显示
     *           1：不显示
     */
    private Integer isShow;
    @TableField(exist = false)
    private Boolean hideMenu;
    private Integer isKeep;
    @TableField(exist = false)
    private Boolean ignoreKeepAlive;

    /**
     * 0:false
     * 1:true 有一级菜单但是不需要展示二级菜单  隐藏子菜单
     */
    private Integer childrenMenu;
    @TableField(exist = false)
    private Boolean hideChildrenInMenu;

    /** 乐观锁版本号 */
    @ApiModelProperty("乐观锁版本号")
    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

    private Integer IsDeleted;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

}
